package com.company.cloud.user.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.user.modules.api.request.PermissionAddRequest;
import com.company.cloud.user.modules.api.request.PermissionGet2DelRequest;
import com.company.cloud.user.modules.api.request.PermissionQueryRequest;
import com.company.cloud.user.modules.api.request.PermissionUpdateRequest;
import com.company.cloud.user.modules.api.response.PermissionQueryResp;
import com.company.cloud.user.modules.api.response.PermissionModel;
import com.company.cloud.user.modules.api.response.UserBaseResp;
import com.company.cloud.user.modules.api.service.PermissionPlatformRemoteService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

@Log4j2
@Component
public class PermissionPlatformRemoteServiceFallbackFactory implements FallbackFactory<PermissionPlatformRemoteService> {
    @Override
    public PermissionPlatformRemoteService create(Throwable cause) {
        return new PermissionPlatformRemoteService() {
            @Override
            public BaseClientResult<PermissionQueryResp> queryPermission(PermissionQueryRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<PermissionModel> addPermission(PermissionAddRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<PermissionModel> updatePermission(PermissionUpdateRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<PermissionModel> infoPermission(PermissionGet2DelRequest request) {
                return BaseClientResult.callbackError();
            }

            @Override
            public BaseClientResult<String> delPermission(PermissionGet2DelRequest request) {
                return BaseClientResult.callbackError();
            }
        };
    }
}
